<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="Cp1251"%>
<%@ taglib uri="/WEB-INF/st4" prefix="st"%>

	<h2>
		<st:i18n key="pages.summary" />
	</h2>
	<table border="1" cellspacing="0" cellpadding="4">
		<tr>
			<td style="width: 20px;">#</td>
			<td style="width: 300px;"><st:i18n key="pages.flight" /></td>
			<td style="width: 80px;"><st:i18n key="pages.price" /></td>
			<td style="width: 200px;"><st:i18n
					key="pages.additional_service" /></td>
			<td style="width: 70px;"><st:i18n
					key="pages.additional_price" /></td>
			<td style="width: 70px;"><st:i18n key="pages.subtotal" /></td>
		</tr>

		<tr>
			<td>1</td>
			<td><c:forEach items="${directTicket.getFlights()}"
					var="flight">
				${flight.getSchedule().getShortDescription()}<br/>
			</c:forEach>
			</td>
			<td><c:forEach items="${returnTicket.getFlights()}" var="flight">
				${flight.getPrice()}$<br/>
			</c:forEach></td>
			<td>
				<table>
					<c:forEach items="${directTicket.getServices()}" var="service">
						<tr>
							<td><st:i18n key="additional_services.id_${service.id}" /></td>
							<td style="text-align: center;">${service.price}$</td>
						</tr>
					</c:forEach>
				</table>
			</td>
			<td>${directTicket.getServicesPrice()}$</td>
			<td>${directTicket.getCalculatedPrice()}$</td>
		</tr>

		<c:if test="${not empty returnTicket}">

		<tr>
			<td>2</td>
			<td>
			<c:forEach items="${returnTicket.getFlights()}" var="flight">
				${flight.getSchedule().getShortDescription()}<br/>
			</c:forEach>
			</td>
			<td><c:forEach items="${returnTicket.getFlights()}" var="flight">
				${flight.getPrice()}$<br/>
			</c:forEach>
			<td><table>
					<c:forEach items="${returnTicket.getServices()}" var="service">
						<tr>
							<td><st:i18n key="additional_services.id_${service.id}" /></td>
							<td style="text-align: center;">${service.price}$</td>
						</tr>
					</c:forEach>
				</table></td>
			<td>${returnTicket.getServicesPrice()}$</td>
			<td>${returnTicket.getCalculatedPrice()}$</td>
		</tr>
		
		</c:if>

		<tr>
			<td>3</td>
			<td colspan="4"><st:i18n key="pages.your_personal_saving" /></td>
			<td>${returnTicket.getUser().getStatus().getSaving()}%</td>
		</tr>

		<tr>
			<td>4</td>
			<td colspan="4"><st:i18n key="pages.total_price" /></td>
			<td>${(directTicket.calculatedPrice+returnTicket.calculatedPrice)*(100-user.status.saving)/100}$</td>
		</tr>

	</table>
					

			